using System;
namespace Shlick
{
	public delegate void CommandHandler();

	// For when making a ICommand subclass is too much, and just want to provide delegates.
	public class DelegateCommand : ICommand
	{
		private string name;
		public string Name { get { return this.name; } }
		public CommandHandler DoDelegate;
		public CommandHandler UndoDelegate;
		
		public DelegateCommand(string name)
		{
			this.name = name;
		}
		
		public void Do()
		{
			if (this.DoDelegate != null)
				this.DoDelegate();
		}
		
		public void Undo()
		{
			if (this.UndoDelegate != null)
				this.UndoDelegate();
		}
	}
}

